package com.web.kdl.pojo.Vo.flywheel;

import com.web.kdl.pojo.dto.FlywheelMainDto;
import lombok.Data;

import java.util.List;

/**
 * @Author： shulibin
 * @Date： 2025/7/25 15:01
 * @Describe：
 */
@Data
public class FlywheelMainInfoVo {
//    通信模式-status
    private String  communicationMode;
//    系统SOC % data
    private String  systemSOC;
//    系统容量 kw.H data
    private String  systemEne;
//    转子温度位移推算值 data
    private String  rotTF;
//    转速 rps data
    private String  motSpe;
//    真空度1 Pa data
    private String  vac;
//   电机工作状态 status
    private String  motWorkSta;
//    母线电压 V data
    private String  busV;
//    相电流有效值 A data
    private String  cuCur;
//    电机输出功率  KW data
    private String  motOutP;
//    柜内环境温度 ℃  data
    private String  envTemp;
//    空调运行状态 status
    private String  airRunSta;
//    驱动1组运行状态 status
    private String  drive1GroupStatus;
//    驱动2组运行状态   status
    private String  drive2GroupStatus;
//    驱动1组母线电压1 V data
    private String  drive1BusV;
//    驱动2组母线电压1 V  data
    private String  drive2BusV;
//    上端轴向位移1 um  data
    private String  upAxisDis1;
//    上端轴向位移2 um  data
    private String  upAxisDis2;
//    下端轴向位移1 um    data
    private String  downAxisDis1;
//    下端轴向位移2 um    data
    private String  downAxisDis2;
//  当前时间
//    private String  time;

    public FlywheelMainInfoVo(List<FlywheelMainDto> flywheelMainDtos) {
        for (FlywheelMainDto dto : flywheelMainDtos){
            switch (dto.getDeviceName()){
                case "通信模式":
                    this.communicationMode = dto.getDataValue();
                    break;
                case "系统SOC":
                    this.systemSOC = dto.getDataValue()+dto.getUnit();
                    break;
                case "系统容量":
                    this.systemEne = dto.getDataValue()+dto.getUnit();
                    break;
                case "转子温度位移推算值":
                    this.rotTF = dto.getDataValue();
                    break;
                case "转速":
                    this.motSpe = dto.getDataValue()+dto.getUnit();
                    break;
//              TODO 真空度 数据库中存在 真空度1 和 真空度2 暂取真空度1
                case "真空度1":
                    this.vac = dto.getDataValue()+dto.getUnit();
                    break;
                case "电机工作状态":
                    this.motWorkSta = dto.getDataValue();
                case "母线电压":
                    this.busV = dto.getDataValue()+dto.getUnit();
                    break;
                case "相电流有效值":
                    this.cuCur = dto.getDataValue()+dto.getUnit();
                    break;
                case "电机输出功率":
                this.motOutP=dto.getDataValue()+dto.getUnit();
                    break;
                case "柜内环境温度":
                    this.envTemp = dto.getDataValue();
                    break;
                case "空调运行状态":
                    this.airRunSta = dto.getDataValue();
                    break;
                case "驱动1组运行状态":
                    this.drive1GroupStatus = dto.getDataValue();
                    break;
                case "驱动2组运行状态":
                    this.drive2GroupStatus = dto.getDataValue();
                    break;
                case "驱动1组母线电压1":
                    this.drive1BusV = dto.getDataValue()+dto.getUnit();
                    break;
                case "驱动2组母线电压1":
                    this.drive2BusV = dto.getDataValue()+dto.getUnit();
                    break;
                case "上端轴向位移1":
                    this.upAxisDis1 = dto.getDataValue()+dto.getUnit();
                    break;
                case "上端轴向位移2":
                    this.upAxisDis2 = dto.getDataValue()+dto.getUnit();
                    break;
                case "下端轴向位移1":
                    this.downAxisDis1 = dto.getDataValue()+dto.getUnit();
                    break;
                case "下端轴向位移2":
                    this.downAxisDis2 = dto.getDataValue()+dto.getUnit();
                    break;
            }
        }
    }

}
